﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using University.Workshop.Presentation.ControlWPF.TransitionControl;
using University.Workshop.Presenters.Kardex.Modify;

namespace University.Workshop.Presentation.Kardex.Modify
{
    /// <summary>
    /// Interaction logic for PageModifyView.xaml
    /// </summary>
    public partial class PageModifyView : Page,IModifyKardexProductView
    {
        PresenterModifyKardexView pModifyKardexView;
        public PageModifyView(Model.Kardex kardex)
        {
            pModifyKardexView = new PresenterModifyKardexView(this,kardex);
            InitializeComponent();
        }

        private void GoStepOne_Click(object sender, RoutedEventArgs e)
        {
            pModifyKardexView.GoStepOne();
        }

        private void GoStepTwo_Click(object sender, RoutedEventArgs e)
        {
            pModifyKardexView.GoStepTwo();
        }

        private void btnCancelModify_Click(object sender, RoutedEventArgs e)
        {
            ReturnSearchKardex();
        }

        private void btnModifyKardex_Click(object sender, RoutedEventArgs e)
        {
            pModifyKardexView.ModifyKardex();
        }

        private void btnBack_Click(object sender, RoutedEventArgs e)
        {
            pModifyKardexView.GoBackPage();
        }

        private void btnNext_Click(object sender, RoutedEventArgs e)
        {
            pModifyKardexView.GoNextPage();
        }


        public void CallSecondPage()
        {
            PageFirstModifyKardexView pp = new PageFirstModifyKardexView(pModifyKardexView);
            ModifyBasic = pp;
            frmContent.Navigate(pp);
            GoStepTwo.IsEnabled = true;

        }

        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            pModifyKardexView.FirstTime();
        }

        public void CallFirstPage()
        {
            PageSecondStepModifyKardex pp = new PageSecondStepModifyKardex(pModifyKardexView);
            ModifyBasic = pp;
            frmContent.Navigate(pp);
        }


        public Presenters.Kardex.Modify.IModifyBasicView ModifyBasic
        {
            get; set;
        }
        
        public void SystemMessage(string MessageValue)
        {
            MessageBox.Show(App.Current.MainWindow, MessageValue, "Atencion!!!", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK, MessageBoxOptions.RightAlign);
        }

        public void ErrorMessage(string MessageValue)
        {
            MessageBox.Show(App.Current.MainWindow, MessageValue, "Error!!!",MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK,MessageBoxOptions.RightAlign);
        }

        public void ReturnSearchKardex()
        {
            this.NavigationService.Navigate(new SearchKardex());
        }
    }
}
